/**
 * 
 */
package it.unical.canonaco.rende.igpe.game.cbv.guilayer.gamemanagermenu;

import java.awt.Point;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.List;

/**
 * @author Massimo Canonaco
 *
 */
public class ClickMouseMapListener implements MouseListener {

	private int columnMapSize;
	private int rowMapSize;
	
	private int tile;
	
//	private List<Point> clickedPoints;
	
	public ClickMouseMapListener(int column, int row, int tile)
	{
//		clickedPoints = list;
		columnMapSize = column;
		rowMapSize = row;
		this.tile = tile;
	}
	
	public Point getPoint(int x, int y)
	{
		Point point = new Point();
		this.calculatePoint(point, x, y);
		return point;
	}
	
	public void calculatePoint(Point point, int x, int y)
	{
		x = x/tile;
		y = y/tile;
		
		point.x = (x >= rowMapSize)? rowMapSize : x;
		point.y = (y >= columnMapSize)? columnMapSize : y;
	}
	/* (non-Javadoc)
	 * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
	 */
	@Override
	public void mouseClicked(MouseEvent e) 
	{
		
	}

	/* (non-Javadoc)
	 * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
	 */
	@Override
	public void mouseEntered(MouseEvent e) {

	}

	/* (non-Javadoc)
	 * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
	 */
	@Override
	public void mouseExited(MouseEvent e) 
	{

	}

	/* (non-Javadoc)
	 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
	 */
	@Override
	public void mousePressed(MouseEvent e) 
	{

	}

	/* (non-Javadoc)
	 * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
	 */
	@Override
	public void mouseReleased(MouseEvent e) 
	{

	}
	
//	public Point popPoint()
//	{
//		return clickedPoints.remove(0);
//	}

}
